//书写接口ApI请求函数
import request from "@/utils/request";
import type { LoginData, LoginResponseData, UserInfo } from "@/api/user/type/index";
// 枚举的用途
enum API_URL {
  // 登录接口 POST{username,password}
  LOGIN = "/admin/acl/index/login",
  USERINFO_URL = "/admin/acl/index/info",
  LOGOUT_URL = "/admin/acl/index/logout",
}
// 登录接口 泛型
export const reqUserLogin = (data: LoginData) =>
  request.post<any, LoginResponseData>(API_URL.LOGIN, data);
//获取用户信息接口
export const reqUserInfo = () =>
  request.get<any, UserInfo>(API_URL.USERINFO_URL);
// 退出登录
export const reqLogout = () => request.post<any, any>(API_URL.LOGOUT_URL);
